'use strict';

/**
 * @param {Egg.Application} app - egg application
 */
module.exports = app => {
  const { router, controller } = app;
  router.get('/', controller.home.index);

  router.get('/m/:page', controller.home.index);
  router.get('/dist/**', controller.home.proxy_assets);
  router.post('/api/**', controller.home.proxy);

  const other = ['order_show_api', 'pay_center_wxpay', 'order_create', 'coupon_check', 'pay_center_show', 'sms_cloud_send', 'sms_cloud_check', 'uploader_init_image_auth', 'login_bind_social', 'common_video_play_auth'];
  other.forEach((p) => {
    router.post(`/${p}`, controller.home.proxy);
  })
};
